package cn.com.chengmandian.service.erp.constants;

public enum PurchaseApplyStatusEnum {

    //状态 1-草稿 2-审批中 3-采购中 4-采购完成 5-审核失败 6-废弃
    DRAFT(1,"草稿"),
    AUDIT(2,"审批中"),
    PURCHASE(3,"采购中"),
    FINISH(4,"采购完成"),
    FAIL(5,"审核失败"),
    SCRAP(6,"废弃");

    private Integer code;
    public Integer getCode(){
        return this.code;
    }

    private String name;
    public String getName(){
        return this.name;
    }

    public static PurchaseApplyStatusEnum getByCode(Integer code){
        if(code == null){
            return null;
        }else{
            PurchaseApplyStatusEnum[] purchaseApplyStatusEnums = values();
            for(PurchaseApplyStatusEnum purchaseApplyStatusEnum : purchaseApplyStatusEnums){
                if(code.equals(purchaseApplyStatusEnum.getCode())){
                    return purchaseApplyStatusEnum;
                }
            }
        }
        return null;
    }

    PurchaseApplyStatusEnum(Integer code, String name){
        this.code = code;
        this.name = name;
    }
}
